import React, { Component } from 'react';
import {HashRouter as Router,Route} from 'react-router-dom'
import Tabbar from './components/tabbar/Tabbar'
import Index from './components/index/Index'
import Category from './components/category/Category'
import Cart from './components/cart/Cart'
import Mime from './components/mime/Mime'
import SearchCenter from './components/searchCenter/SearchCenter';
import GoodList from './components/goodList/GoodList'
import GoodDetail from './components/goodDetail/GoodDetail'
import Pay from './components/pay/Pay'

class RouterConfig extends Component {
    render() {
        return (          
                <Router>
                    <Route path='/' exact render={() => 
                     <Tabbar><Index></Index></Tabbar>   
                    }></Route>
                    <Route path='/category' exact render={(props) => 
                     <Tabbar><Category {...props}></Category></Tabbar>                     
                    }></Route>
                    <Route path='/cart' exact render={() => 
                     <Tabbar><Cart></Cart></Tabbar>                      
                    }></Route>
                    <Route path='/mime' exact render={() => 
                     <Tabbar><Mime></Mime></Tabbar>   
                    }></Route>
                    <Route path='/searchCenter' exact render={() => 
                     <SearchCenter></SearchCenter>
                    }></Route>
                    <Route path='/goodDetail/:goods_id' exact render={(props) => 
                     <GoodDetail {...props}></GoodDetail>
                    }></Route>
                    <Route path='/goodList/' exact render={(props) => 
                     <GoodList {...props}></GoodList>
                    }></Route>
                    <Route path='/pay' exact render={(props) => 
                     <Pay {...props}></Pay>                 
                    }></Route>
                   
                </Router>
        )
    }
}

export default RouterConfig;
